<?php

namespace app\admin\model\validate;

use think\Validate;

class Guide extends Validate {
    protected $rule =   [
        'title'  => 'require|max:36',
        //'open_id' => 'require',
        'desc' => 'max:45',
        'name' => 'require|max:12|unique:guide',
        'img_url' => 'require|max:256',
        'applet_app_id' => 'require',
        'applet_name' => 'require|max:24',
    ];

    protected $message  =   [
        'title.require' => '引导标题不能为空',
        'title.max' => '引导标题不能超过36个字符',
        'name.require' => '名称不能为空',
        'name.max' => '名称不能超过12个字符',
        'name.unique' => '名称已经存在',
        'img_url.require' => '引导图片不能为空',
        'img_url.max' => '引导图片不能超过255个字符',
        'applet_app_id.require' => '小程序ID不能为空',
        'applet_name.max'     => '小程序名不能超过24个字符',
        'applet_name.require'     => '小程序名不能为空',
    ];

    protected $scene = [
        /*'add'  =>  ['name','theme','start_time', 'end_time', 'attention_tips', 'cover_image_url', 'sort', 'participate_num'],
        'edit'  =>  ['name','theme','start_time', 'end_time', 'attention_tips', 'cover_image_url', 'sort', 'participate_num'],*/
    ];
}